<?php
include_once 'header.php';
$user_info = $pdo->query("select * from yunbbs_users where name='$name'");
foreach ($user_info as $key1 => $value1) {

}
?>
<style>
    #body{
        width: 100%;
        display: flex;
        background-color: #ededed;
    }
    #list_left {
        display: flex;
        width: 70%;
        flex-direction: column;
        align-items: flex-end;
    }
    td {
        /*border:1px solid red;*/
    }
    #bbs_list {
        width: 95%;
        /*border: 1px solid blue;*/
        background-color:white;

    }
    #bbs_re {
        width: 95%;
        /*border: 1px solid blue;*/
        background-color:white;

    }
    #list_right {
        width: 30%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #bbs_right {
        width: 80%;
        /*border: 1px solid blue;*/
        /*display: flex;*/
        background-color:white;
    }
    .message3 {
        margin: 10px 5px;
        width: 70px;
        border: 1px solid #bbb7bb;
    }
    .message2 {
        margin: 10px 5px;
        width: 45px;
        border: 1px solid #bbb7bb;
    }
    table {
        border-collapse: collapse;
    }
</style>
<div id="list_left">
    <div style="height:30px; width: 100%;"></div>
    <div id="bbs_list">
        <div style="height:40px; background-color:#b0b0b0;">
            <span style="line-height:40px; float:left; margin-left: 15px;">mybbs >> 最近更新·PHP905</span>
            <span style="line-height:40px; float:right; margin-right: 15px;"><a href="posting.php">+发新帖</a></span>
        </div>
        <?php
        $yunbbs_articles = $pdo->query("select * from yunbbs_articles");
        foreach ($yunbbs_articles as $keys => $values) {
            ?>
            <div>
                <table style="width:100%;">
                    <tr style="height:40px;background-color:#e8e8e8; ">
                        <td></td>
                        <td colspan="2"><?php echo $values['title'] ?></td>
                    </tr>
                    <tr style="height:40px">
                        <td style="width:40px;"></td>             
                        <td>默认分类·<?php echo $values['comments'] ?>·<?php echo $name ?>·<?php $time = $values['addtime']; echo wordTime($time);?>前</td>
                        <td style="width:20px;"><?php echo $values['comments'] ?></td>
                    </tr>
                </table>
            </div>
        <?php }
        ?>
    </div>
    <div style="height:20px; width: 100%;"></div>
</div>
<div id="list_right">
    <div style="height:30px; width: 100%;"></div>
    <div id="bbs_right">
        <div style="height:40px; background-color:#b0b0b0;">
            <span style="line-height:40px; float:left; margin-left: 15px;">最近添加的分类</span>
        </div>
        <div>
            <div style="display: flex; flex-wrap: wrap;">
                <?php foreach ($yunbbs_categories as $key => $value) { ?>
                    <div class="message3"><a href="#"><?php echo $value['name'] ?></a></div>
                <?php }
                ?>
            </div>
        </div>
    </div>
    <div style="height:20px; width: 100%;"></div>
    <div id="bbs_right">
        <div style="height:40px; background-color:#b0b0b0;">
            <span style="line-height:40px; float:left; margin-left: 15px;">链接</span>
        </div>
        <div>
            <div class="message2">
                <a href="index.php">MyBBS</a>
            </div>
        </div>
    </div>
    <div style="height:20px; width: 100%;"></div>
</div>

<?php
include_once 'footer.php';
?>

